<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="../../js/tools/jquery-1.4.2.min.js"></script>
<script charset="utf-8" src="../../js/editor/kindeditor.js"></script>
<style>
table{table-layout:fixed;font-size:12px;}
  tr{background-color:#F1F6F6;}
  td{border:1px solid #D9D9D9;color:black;padding:2px;}
</style>
<script type="text/javascript">
   $(document).ready(function(){
    KE.show({
				id : 'description',
				resizeMode : 1,
				allowPreviewEmoticons : false,
				allowUpload : false,
				items : []
			});
        var date=new Date();
       $.getJSON("../../groupbyajax/user!getUserCategoryList.action?dateTime="+date.getTime(),{flag:3},function(data)
	     {
	     
	       var category="";
	       for(var i=0;i<data.success.length;i++)
	       {
	         category+="<option value='"+data.success[i].id+"'>"+data.success[i].categoryName+"</option>";
	       }
	      
	         $("#category").html(category);
	     });
   });
   function startSubmit()
{
    var photoName=$("input[name='photoName']").val();
    var description=$("textarea[name='description']").val();
    var tid=$("#tid").val();
    if(photoName.length<1||photoName.length>20)
    {
       alert("相册名称的字数在1到20之间");
       return false;
    }
    if(description.length>100)
    {
       alert("相册描述不能大于100");
       return false;
    }
    return true;
}
</script>
</head>
<body>
 <form action="admin/user/branduser!addPictures.action" onsubmit="return startSubmit();">
 <table  style="width:80%;" align="center">
  <tr><td  align="center"><s:actionerror/></td></tr>
 <tr><td  align="center"><font size=5>创建相册</font></td></tr>
 <tr><td>分   类：<select name="category" id="category"></select></td></tr>
 <tr><td >相册名称（必填）:</td></tr>
 <tr><td ><input type="text" name="photoName"></td></tr>
 <tr><td >相册描述:</td></tr>
 <tr><td><textarea rows="10" cols="80" name="description" id="description"></textarea>  </td></tr>
<tr>
    <td  align="center">
       <input type="submit" value="创建相册">
    </td>
</tr>
</table>
</form>
</body>
</html>